<?php
		defined('BY_JYA') or exit('error');
		list($tmpname, $xmax, $ymax)=$arguments;
		$ext = explode(".", $filename);
		$ext = $ext[count($ext)-1];	 
		$im=imagecreatefromstring(file_get_contents($tmpname));	
		$x = imagesx($im);
		$y = imagesy($im);
		if($x <= $xmax && $y <= $ymax){
			return $im;
		}	 
		$im2 = imagecreatetruecolor($xmax, $ymax);
		imagecopyresized($im2, $im, 0, 0, 0, 0, floor($xmax), floor($ymax), $x, $y);
		return $im2;
		
	
